-
Notifications
You must be signed in to change notification settings - Fork 286
Use simplify_exprtt::resultt in pre-order simplification steps #6118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #6118 +/- ##
===========================================
+ Coverage 77.75% 78.94% +1.18%
===========================================
Files 1701 1701
Lines 196465 196502 +37
===========================================
+ Hits 152762 155120 +2358
+ Misses 43703 41382 -2321
☔ View full report in Codecov by Sentry. |
dcfd7c9 to
60b7032
Compare
60b7032 to
5f72bec
Compare
| auto r_truevalue = simplify_rec(swap_branches ? falsevalue : truevalue); | ||
| if(swap_branches) | ||
| r_truevalue.expr_changed = CHANGED; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? The if-expression will be marked as changed anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but build_if_expr would not actually replace the truevalue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have refactored the code and added a comment.
5f72bec to
dded843
Compare
dded843 to
7092be8
Compare
947d049 to
18db8ab
Compare
2d0250e to
337d85b
Compare
337d85b to
119aa52
Compare
119aa52 to
ec6f1fe
Compare
ec6f1fe to
1c38550
Compare
1c38550 to
bcedf46
Compare
bcedf46 to
0d26292
Compare
0d26292 to
5bff566
Compare
The use of resultt increases type safety as the expression to be simplified is no longer modified in place. All post-order simplification steps already use resultt, but pre-order steps had been left to be done.
This avoids repeatedly visiting already-simplified operands. On the example from diffblue#7357 this reduces symex time from 1172 seconds to 922 seconds.
5bff566 to
5d29491
Compare
The use of resultt increases type safety as the expression to be
simplified is no longer modified in place. All post-order simplification
steps already use resultt, but pre-order steps had been left to be
done.